package com.cskaoyan.service;

import com.cskaoyan.bean.BaseData;
import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.administrators.Admin;
import com.cskaoyan.bean.administrators.Log;
import com.cskaoyan.bean.administrators.Storage;
import com.cskaoyan.bean.administrators.bo.AdminCreateBO;
import com.cskaoyan.bean.administrators.bo.RoleCreateBO;
import com.cskaoyan.bean.administrators.bo.RolePermissionsBO;
import com.cskaoyan.bean.administrators.bo.RoleUpdateBO;
import com.cskaoyan.bean.administrators.vo.*;

import com.fasterxml.jackson.core.JsonProcessingException;

import com.cskaoyan.bean.promotion.storage.UploadPicStorageVO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Date;
import java.util.List;


/**
 * @Description: 系统管理
 * @Author: 徐能雄
 * @Date: 2021/9/15 17:02
 */
public interface AdministratorsService {
    BaseData<AdminListVO> adminList(BaseParam param, String username);

    RoleOptionsVO roleOptions();

    AdminCreateVO adminCreate(AdminCreateBO adminCreateBO);

    int adminDelete(AdminCreateBO deleteCreateBO);

    AdminUpdateVO adminUpdate(AdminCreateBO updateCreateBO);

    BaseData<Log> logList(BaseParam param, String username);

    void logWriter(BaseRespVo result, String username, Date lastLoginTime, Integer type, String work, boolean status,String result2,String comment);

    BaseData<RoleListVO> roleList(BaseParam param, String name);

    RoleCreateVO roleCreate(RoleCreateBO roleCreateBO);

    int roleDelete(RoleUpdateBO roleDeleteBO);

    int roleUpdate(RoleUpdateBO roleUpdateBO);

    RolePermissionsVO roleGetPermissions(Integer roleId) throws JsonProcessingException;

    int rolePostPermissions(RolePermissionsBO rolePermissionsBO);

    BaseData<StorageListVO> storageList(BaseParam param, String key, String name);

    Storage storageCreate(MultipartFile myFile) throws IOException;

    int storageDelete(StorageListVO storageUpdateBO);

    StorageListVO storageUpdate(StorageListVO storageUpdateBO);

    /**
     * 上传照片
     * @param file
     * @return  UploadPicStorageVO
     */
    UploadPicStorageVO setPic(MultipartFile file) throws IOException;


    Admin getAdmin(String username);

    List<String> getRoles(Admin admin);

    List<String> getPerms(Admin admin);
}
